function deepClone(obj) {
  if(typeof obj != 'object') return obj
  var temp = Array.isArray(obj) ? [] : {}
  for(let key in obj) {
    if(obj.hasOwnProperty(key)) {
      if(obj[key] && obj[key] == 'object') {
        temp[key] = deepClone(obj[key])
      } else {
        temp[key] = obj[key]
      }
    }
  }
  return temp
}
let info = {
  name: 'lyh',
  age: 22,
  nowtime: '2022-5-30 15:21',
  habit: {
    name: 'game',
    method: 'play'
  }
}

let infoDeepCopy = deepClone(info)
console.log(infoDeepCopy);